package com.attendance.web;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Page;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import com.attendance.entity.dto.LeaveDTO;
import com.attendance.service.ILeaveService;
import com.common.util.ExtjsPageable;

@Controller
@RequestMapping("/staffLeave")
public class LeaveController {
	@Autowired
	private ILeaveService leaveService;
	
	@RequestMapping("/findPage")
	public @ResponseBody Page<LeaveDTO> findPage(String staffName,String staffNum,ExtjsPageable pageable){
		try {
			return leaveService.findPage(staffName, staffNum, pageable.getPageable());
		} catch (Exception e) {
			e.printStackTrace();
			return null;
		}
	}
}
